import lodash from 'lodash';
import api from '@/axios/api';
import { Base } from '@/components/base/common';

export type BaseFormType = Partial<typeof baseForm>
export type AllFormKeysArrType = Array<keyof BaseFormType>
export type BaseDVType = BaseFormType & { orderByInList?: Array<typeof orderByInList[number]> }

export const base: Base = {
  idKey: '${idName}',
  permission: '${permission}',
  baseApi: () => api.${api},
  baseForm: () => ({ ...baseForm }),
  baseRules: () => lodash.cloneDeep(baseRules),
  baseDict: () => lodash.cloneDeep(baseDict),
  buildPer: (p) => '${permission}:' + p,
}

const baseForm = {
${baseFormParams}}

const baseRules = {
${formRules}}

const baseDict = {
${dictParams}}

const orderByInList = [
${orderByInList}

/*
${baseColumns}*/

/*
${formItems}*/

/*
${tableColumns}*/